package com.wdh.kjs.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.wdh.kjs.R;

/**
 * Created by feifei on 2016/4/28.
 */
public class MessagePushActivity extends BaseTopActivity implements View.OnClickListener{
    private ImageView switch_1;
    private ImageView switch_2;
    private Boolean isChange = false;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.message_push);
        initview();
    }

    private void initview() {
        initTopBar("推送设置");
        switch_1 = (ImageView)findViewById(R.id.switch_1);
        switch_1.setOnClickListener(this);
        switch_2 = (ImageView)findViewById(R.id.switch_2);
        switch_2.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId())
        {
            case R.id.switch_1:
                if(isChange){
                    switch_1.setBackgroundDrawable(getResources().getDrawable(R.drawable.close_icon));
                }else
                {
                    switch_1.setBackgroundDrawable(getResources().getDrawable(R.drawable.open_icon));
                }
                isChange = !isChange;
                break;
            case R.id.switch_2:
                if(isChange){
                    switch_2.setBackgroundDrawable(getResources().getDrawable(R.drawable.close_icon));
                }else
                {
                    switch_2.setBackgroundDrawable(getResources().getDrawable(R.drawable.open_icon));
                }
                isChange = !isChange;
                break;
        }

    }
}
